package com.walleipt;

import com.alibaba.dubbo.common.URL;
import org.apache.dubbo.common.extension.ExtensionLoader;

public class Extension_test {

    public static void main(String[] args) {

        // getAdaptiveExtension 调用默认
        ExtensionLoader<Echoer> extensionLoader_1 = ExtensionLoader.getExtensionLoader(Echoer.class) ;
        Echoer echoer = extensionLoader_1.getAdaptiveExtension() ;
        echoer.echo( URL.valueOf("test://") );

        System.err.println("\n===========================华丽的分割线=======================================\n");

        // getExtension 调用指定的
        ExtensionLoader<Echoer> extensionLoader_2 = ExtensionLoader.getExtensionLoader(Echoer.class) ;
        Echoer echoerWrap = extensionLoader_2.getExtension("impl1") ;
        echoerWrap.echo( URL.valueOf("test://") );
    }
}
